home *** CD-ROM | disk | FTP | other *** search
/ 3D Game Programming All in One / 3D Game Programming All in One Disc.iso / 3D2E / RESOURCES / CH6 / EMAGA6 / control / server / initialize.cs next >
Encoding:
Text File  |  2006-09-25  |  2.7 KB  |  71 lines

  1. //============================================================================
  2. // control/server/initialize.cs
  3. //
  4. //  server control initialization module for 3D2E emaga6 sample game
  5. //
  6. //  Copyright (c) 2003 by Kenneth C.  Finney.
  7. //============================================================================
  8. $Pref::Server::AdminPassword = "";
  9. $Pref::Server::BanTime = 1800;
  10. $Pref::Server::ConnectionError = "You do not have the correct version of 3D2E client or the related art needed to play on this server. This is the server for Chapter 6. Please check that chapter for directions.";
  11. $Pref::Server::FloodProtectionEnabled = 1;
  12. $Pref::Server::Info = "3D Game Programming All-In-One, Second Edition by Kenneth C. Finney.";
  13. $Pref::Server::KickBanTime = 300;
  14. $Pref::Server::MaxChatLen = 120;
  15. $Pref::Server::MaxPlayers = 64;
  16. $Pref::Server::Name = "3D2E Book - Chapter 6 Server";
  17. $Pref::Server::Password = "";
  18. $Pref::Server::Port = 28000;
  19. $Pref::Server::RegionMask = 2;
  20. $Pref::Server::TimeLimit = 20;
  21.  
  22. $Pref::Net::LagThreshold = "400";
  23. $pref::Net::PacketRateToClient = "10";
  24. $pref::Net::PacketRateToServer = "32";
  25. $pref::Net::PacketSize = "200";
  26. $pref::Net::Port = 28000;
  27.  
  28. function InitializeServer()
  29. //----------------------------------------------------------------------------
  30. // Prepare some global server information & load the game-specific module
  31. //----------------------------------------------------------------------------
  32. {
  33.    Echo("\n++++++++++++ Initializing module: emaga6 server ++++++++++++");
  34.    $Server::GameType = "3D2E";
  35.    $Server::MissionType = "Emaga6";
  36.    $Server::Status = "Unknown";
  37.    $Server::TestCheats = true;
  38.  
  39.    // Specify where the mission files are.
  40.    $Server::MissionFileSpec = "*/maps/*.mis";
  41.  
  42.    InitBaseServer(); // basic server features defined in the common modules
  43.  
  44.    // Load up game server support script
  45.    Exec("./server.cs");
  46. }
  47.  
  48. function InitializeDedicatedServer()
  49. //------------------------------------------------------------------------
  50. // Dedicated server will need a windows console and an initial start
  51. //    mission. It always launches in multiplayer mode, of course.
  52. //------------------------------------------------------------------------
  53. {
  54.    EnableWinConsole(true);
  55.    Echo("\n--------- Starting Dedicated Server ---------");
  56.  
  57.    // Make sure this variable reflects the correct state.
  58.    $Server::Dedicated = true;
  59.  
  60.    // The server isn't started unless a mission has been specified.
  61.    if ($missionArg !$= "") {
  62.       CreateServer("MultiPlayer", $missionArg);
  63.    }
  64.    else
  65.       Echo("No map specified (use -map filename)");
  66. }
  67.  
  68.  
  69. function onNeedRelight() // stub routine to stop console error spam
  70. {
  71. }